package file;

import java.io.File;

public class DeleteFileDirDemo {
    public static void main(String[] args) {
        //File f = new File("./test.txt");//文件
        //File f = new File("./demo");//删除demo
        //File f = new File("./a/b/c/d/e");//删除a下的b下的c下的d下的e
        File file = new File("./test.txt");
        if (file.exists()){
            file.delete();
            System.out.println("该文件已删除!");
        }else {
            System.out.println("该文件不存在!");
        }
    }
}
